package goutil

import "errors"

// https://colobu.com/2021/10/10/faster-time-parsing/
var errNotNumber = errors.New("not a valid number")

func Atoi2(in string) (int, error) {
	_ = in[1]
	a, b := int(in[0]-'0'), int(in[1]-'0')
	if a < 0 || a > 9 || b < 0 || b > 9 {
		return 0, errNotNumber
	}
	return a*10 + b, nil
}
